import fitlog
import random
import os
######hyper

######hyper

log_dir = str(__file__).split(".")[0]
if not os.path.exists(log_dir):
    os.system("mkdir %s"%log_dir)

for t in range(10):
    hyper = {
        "Lambda": 0.9*t,
        "delta": 0.7*t,
        "theta": 0.2*t,
        "belta": 0.1*t
    }
    fitlog.set_log_dir("%s/"%log_dir, new_log=True)
    # fitlog.add_hyper_in_file (__file__)
    fitlog.add_hyper(hyper, name="test")
    for epoch in range(5):
        for step in range(100):
            fitlog.add_loss(random.random(), name="Loss", step=step, epoch=epoch)
            fitlog.add_metric({"dev":{"acc":random.random(), "loss":random.random()*5}}, step=step)
            fitlog.add_best_metric({"test": {"acc": random.random(), "loss": random.random() * 5}})
    fitlog.finish()